<template>
  <div class="outer">
    <h1>Header</h1>
    <p>count的值{{ count }}</p>
    <p>价格是{{ price }}</p>
    <p>{{ movieList.length }}</p>
    <button @click="increment">累加</button>
    <button @click="incrementN({ n: 3 })">累加n</button>
    <button @click="decrement">累减</button>
    <button @click="waitIncrementAction({ n: 5 })">等会在加</button>
  </div>
</template>

<script>
import { mapState, mapMutations, mapActions } from "vuex";
export default {
  name: "Header",
  data() {
    return {};
  },
  computed: {
    ...mapState("count",["count", "price", "movieList"]),
  },
  methods: {
    ...mapMutations("count",["increment", "incrementN", "decrement"]),
    ...mapActions("count",["waitIncrementAction"]),
  },
};
</script>

<style scoped>
.outer {
  background-color: #3cf;
}
</style>